#define _CRT_SECURE_NO_WARNINGS 1
#include<stdio.h>
int main()
{
    int i = 0, count = 0, arr[1000], brr[1000], crr[1000];
    char huansuan[1000];
    while (scanf("%d%c%d=%d", &arr[i], &huansuan[i], &brr[i], &crr[i]) != EOF)
    {
        i++;
        getchar();
    }
    for (int j = 0; j < i; j++)
    {
        if ((huansuan[j] == '+' && arr[j] + brr[j] == crr[j]) || (huansuan[j] == '-' && arr[j] - brr[j] == crr[j]))
            count++;
    }
    printf("%d", count);
    return 0;
}